#include "Niveau.h"

void nivInit(Terrain* ter,int n)
{
    int i,j;
    if(n==1)
    {
        terInit(ter,15,16);
        const char terrain_default[16][15]={"###############",
                "#             #",
                "# # # # # # # #",
                "# # # # # # # #",
                "# # # # # # # #",
                "# # # # # # # #",
                "#     # #     #",
                "## ##     ## ##",
                "#     # #     #",
                "# # # ### # # #",
                "# # # # # # # #",
                "# # # # # # # #",
                "# # #     # # #",
                "#     ###     #",
                "#     #B#     #",
                "###############"
                                };
        for(i=0;i<ter->dimy;i++)
        {
            for(j=0;j<ter->dimx;j++)
            {
                ter->tab[i][j]=terrain_default[i][j];
            }
        }
    }
    if(n==2)
    {
        terInit(ter,15,16);
        const char terrain_defaut[16][15]={"###############",
                "#   A   A     #",
                "# # A   # # # #",
                "# #    ## #A# #",
                "#   #     A   #",
                "#V  #  A  #V#A#",
                "#VV   #  A V  #",
                "# ###VVVA  V# #",
                "#   AV# # # # #",
                "#A# A # #   # #",
                "# # # ### #A# #",
                "# # #         #",
                "# #       # # #",
                "# #   ### ### #",
                "#     #B#     #",
                "###############"};
            for(i=0;i<ter->dimy;i++)
            {
                for(j=0;j<ter->dimx;j++)
                {
                    ter->tab[i][j]=terrain_defaut[i][j];
                }
            }
    }
    if(n==3)
    {
        terInit(ter,17,16);
        const char terrain_default[16][17]={"#################",
                "#    #      #   #",
                "# VVV#       AAA#",
                "##VVV           #",
                "#VVVV   # ##### #",
                "#VVVV###  #  #  #",
                "#VVVV  #     #  #",
                "# V    AAA   #  #",
                "# #  # ###VVVV  #",
                "### ## #  VVVV  #",
                "#     #   VVVV  #",
                "##  A     VVV   #",
                "### A     VVV   #",
                "#A##  ### #     #",
                "#     #B#       #",
                "#################"};
        for(i=0;i<ter->dimy;i++)
        {
            for(j=0;j<ter->dimx;j++)
            {
                ter->tab[i][j]=terrain_default[i][j];
            }
        }
    }
}

void nivLibere(Terrain* ter)
{
    terLibere(ter);
}
